import Axios from "axios";
import Qs from 'qs'
export default {
    /**
     * 获取所有组件
     */
    getAllMatchUrlPlug: function ({matchUrlId}) {
            const params={
              matchUrlId : matchUrlId
            };
       return Axios.post('/crawler/api/parser/getAllMatchUrlPlug',Qs.stringify(params),{headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
    },
    insertMatchUrlPlugItemAttr : function (params){
        return Axios.post('/crawler/api/parser/insertMatchUrlPlugItemAttr',Qs.stringify(params),{headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
    },
    updateMatchUrlPlugItemAttr : function (params){
         return Axios.post('/crawler/api/parser/updateMatchUrlPlugItemAttr',Qs.stringify(params),{headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
    },
    deleteMatchUrlPlugItemAttr : function ({itemid}) {
        const params={
        itemid : itemid
        };
         return Axios.post('/crawler/api/parser/deleteMatchUrlPlugItemAttr',Qs.stringify(params),{headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
    },
  /**html.vue接口 start**/
    getAllMatchUrlPlugItemAttr : function ({plugId,currentPage,pageSize}) {
    const params={
      plugId : plugId,
      page :currentPage,
      rows : pageSize
    };
    return Axios.post('/crawler/api/parser/getAllMatchUrlPlugItemAttr/page',Qs.stringify(params),{headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
  },
  /**html.vue接口 end**/
  saveFileInfo : function (params){
   return Axios.post('/crawler/api/parser/saveFileInfo',Qs.stringify(params),{headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
  },
  getFileInfo :function ({plugId}){
     const params={
        plugId : plugId
      };
      return Axios.post('/crawler/api/parser/getFileInfo',Qs.stringify(params),{headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
  },
  deleteScript : function ({file_id}){
   const params={
          file_id : file_id
    };
       return Axios.post('/crawler/api/parser/deleteScript',Qs.stringify(params),{headers: {'Content-Type': 'application/x-www-form-urlencoded'}});
  }


}
